function getRandomInt(max) {
  const count = Math.floor(Math.random() * max)
  return count > 0 ? count : 1
}

function getUrl() {
  const count = getRandomInt(16)
  return `/images/${count}.jpg`
}

function getData() {
  const data = Array.from({ length: 9 }).map((item, index) => {
    return {
      id: getRandomInt(100) + index,
      gameName: `测试测试测试`,
      title: '标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题',
      imgUrl: getUrl(),
      height: getRandomInt(150) + 100,
      author: `作者${index + 1}`,
      connect: getRandomInt(100),
      type: 'img',
    }
  })
  data.push({
    id: new Date().getTime(),
    gameName: '王者荣耀',
    title: '王者荣耀李白',
    imgUrl: `/images/18.jpg`,
    videoUrl: `/images/17.mp4`,
    type: 'video',
    author: '倚椅听风',
    connect: 100,
    height: 100,
  })

  return data
}

function getList1() {
  // 模拟数据
  return {
    code: 200,
    data: getData(),
  }
}

function getList2() {
  return {
    code: 200,
    data: getData(),
  }
}

export default {
  getList1,
  getList2,
}
